package com.sali;

import com.sali.netty.NettyService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.concurrent.ExecutorService;

@SpringBootApplication
public class NettyServerApplication {

    @Resource(name = "commonExecutor")
    private ExecutorService executorService;

    @Resource
    private NettyService nettyService;

    @PostConstruct
    public void init() {
        executorService.execute(() -> nettyService.start());
    }

    public static void main(String[] args) {
        SpringApplication.run(NettyServerApplication.class, args);
    }

}
